package com.sun.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//Rest模式
@RestController
@RequestMapping("/bookev")
public class BookEnvironmentController {

    @Autowired
    private Environment environment;

    @GetMapping
    public String getById(){
       System.out.println(environment.getProperty("lession"));
       System.out.println(environment.getProperty("enterprise.name"));
       System.out.println(environment.getProperty("enterprise.subject[0]"));
        return "springboot is running...";
    }
}